package repository

import "gitee.com/jinmingzhi/kit/rdb"

const (
	AREA         = "area"
	COURSE       = "course"
	BATCHTIME    = "batch_time"
	PAY          = "pay"
	USER         = "user"
	USERDETAIL   = "user_detail"
	AREASCHOOl   = "area_school"
	SCHOOLREPORT = "school_report"
)

var (
	MysqlCli         rdb.Repository
	UserRepo         User
	AreaRepo         Area
	AreaSchoolRepo   AreaSchool
	BatchTimeRepo    BatchTime
	CourseRepo       Course
	PayRepo          Pay
	SchoolReportRepo SchoolReport
)

func InitGlobal() {
	MysqlCli = rdb.NewMySQLRepository(rdb.MustLoadConfig())
	UserRepo = NewUser(MysqlCli)
	AreaRepo = NewArea(MysqlCli)
	AreaSchoolRepo = NewAreaSchool(MysqlCli)
	BatchTimeRepo = NewBatchTime(MysqlCli)
	CourseRepo = NewCourse(MysqlCli)
	PayRepo = NewPay(MysqlCli)
	SchoolReportRepo = NewSchoolReport(MysqlCli)

}
